Skip to content

Add -Cn/--csv-no-header option to rdump#170

Merged
yunzheng merged 3 commits intomainfrom
csv-no-header
Jun 20, 2025
Merged

Add -Cn/--csv-no-header option to rdump#170
yunzheng merged 3 commits intomainfrom
csv-no-header

Conversation

@yunzheng
Copy link
Member

This allows you to dump the fields as CSV but without the row header.

Also fixes issue that in some cases the selected fields were not propagated to the adapter.

@yunzheng yunzheng requested a review from Copilot June 17, 2025 13:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new "--csv-no-header" option to the rdump tool, allowing users to output CSV files without a header and fixes a regression where the selected fields were not correctly propagated to the adapter.

  • Adds the "csv-no-header" mode option and corresponding alias in the argument parser.
  • Updates the CSV adapter to conditionally write the header based on the new parameter.
  • Introduces regression tests to verify that selected fields are properly handled for both modes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_regression.py Adds regression tests to verify selected fields propagation and CSV header behavior.
flow/record/tools/rdump.py Updates argument parsing and URI construction to support the new csv-no-header mode.
flow/record/adapter/csvfile.py Enhances the CSV adapter to conditionally write the header based on the new header parameter.

@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.90%. Comparing base (1476f7a) to head (0c2132b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
flow/record/adapter/elastic.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   82.82%   82.90%   +0.07%     
==========================================
  Files          34       34              
  Lines        3576     3592      +16     
==========================================
+ Hits         2962     2978      +16     
  Misses        614      614              
Flag Coverage Δ
unittests 82.90% <93.10%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yunzheng yunzheng requested a review from Schamper June 18, 2025 10:56
@yunzheng yunzheng force-pushed the csv-no-header branch 2 times, most recently from 47801f9 to c4e39a6 Compare June 18, 2025 11:11
yunzheng and others added 3 commits June 20, 2025 15:51
This allows you to dump the fields as CSV but without the row header.

Also fixes issue that in some cases the selected fields were not
propagated to the adapter.
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
@yunzheng yunzheng merged commit 6e8c6db into main Jun 20, 2025
24 checks passed
@yunzheng yunzheng deleted the csv-no-header branch June 20, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants